package com.heart.house.biz.mapper;

import com.heart.house.common.model.*;
import com.heart.house.common.page.PageParams;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface HouseMapper {

    /**
     * 根据条件查询并分页
     *
     * @param house
     * @param pageParams
     * @return
     */
    List<House> selectPageHouses(@Param("house") House house, @Param("pageParams") PageParams pageParams);

    /**
     * 根据条件查询总条数
     *
     * @param house
     * @return
     */
    Long selectPageCount(@Param("house") House house);

    int insertHouseUser(HouseUser houseUser);

    List<Community> selectCommunity(Community community);

    int insertUserMsg(UserMsg userMsg);

    HouseUser selectSaleHouseUser(Long houseId);

    int insert(House house);

    HouseUser selectHouseUser(@Param("userId") Long userId, @Param("houseId") Long houseId, @Param("type") Integer type);

    void updateHouse(House updateHouse);

    void deleteHouseUser(@Param("id") Long id, @Param("userId") Long userId, @Param("value") Integer value);

}
